<?php
/**
 * SMARTY plugin for LiWeb CMS used for easy displaying image thumbnails.
 *
 * @author Martin "DevelX" Jurča
 * @version 2009-08-31
 */
function smarty_function_image($params, &$smarty) {
    if (!isset($params['src'])) {
        return '';
    }
    $image = array(array('cmd' => 'import', 0 => $params['src']));
    if (isset($params['width']) && isset($params['height']) &&
            isset($params['border'])) {
        $image[] = array('cmd' => 'resize', 0 => $params['width'], 1 =>
                $params['height'], 2 => $params['border'], 3 => -1, 4 => true);
    }
    return Kernel::getImageLink($image);
}
?>
